﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace rmfastwin
{
    public partial class FormInfo : Form
    {
        public string InfoPath
        {
            set
            {
                info = DeleteTool.GetInfo(value);
            }
            get { return info.path; }
        }
        DeleteInfo info;
        public FormInfo()
        {
            InitializeComponent();
        }

        private void FormInfo_Load(object sender, EventArgs e)
        {
            button1.Enabled = false;
            begin = DateTime.Now;
        }
        DateTime begin;
        DateTime end;
        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = "文件数量=" + info.filecount;
            label2.Text = "删除数量=" + info.deletecount;
            label3.Text = "错误数量=" + info.errorcount;
            if (info.done)
            {

                button1.Enabled = true;
            }
            else
            {
                end = DateTime.Now;
            }
            var speed = info.deletecount / (end - begin).TotalSeconds;
            label4.Text = "删除速度 每秒:" + (int)speed + " 用时秒:" + (int)(end - begin).TotalSeconds;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
